Download as pdf
Download as pdf
You are on page 1of 15
Q.1 What is HTML? Describe its two important terms. Ans: HTML stands for Hypertext Mark-up Language. It is used to create web pages. A browser such as Internet Explorer or Google Chrome is used to read HTML document and display it on the screen as Web pages. It is used to create hypertext document that bring together text, pictures, sounds, video clips and links all in one place. ‘There are two important terms that you need to understand in the name HTML. 1 Hypertext 2 Markup Language Hyperte ‘The term hypertext is used due to the special test in a webpage called hyperlinks. By clicking ‘on these links you can move from one webpage to another. Hyperlinks are used to navigate on the World Wide Web (WWW). Markup Language A web page consist of a series of elements which are represented by tags. For example, if you need a paragraph of text on your webpage, you use it as;

Some Text Here

Here

shows marking of paragraph opening tag and

means marking of paragraph closing tag us. Due to marking of each element, itis called a markup language.

Lam student

Tam in class 9

Iam computer section

[have a computer Q2 Explai Ans’ he steps involved to create a HTML page. OR How to create Webpage? HTML files are plain text files, so they can be created using a simple editor such as Notepad or WordPad, You can follow these four steps to create your first webpage. Step 1. Open text editor like Notepad. Step 2. Write some HTML content, as shown in fig. Step 3. Save the HTML Page with extension .htm or .html Step 4. In order to view your first webpage, just double click the HTML file you saved in step 3. A web browser is automatically opened to show your webpage as shown in Fig. Notepad tes nee a —__——- mMy First Heading

My first paragraph.

dexhtm x CD filey//CyUsers/myuser/Desktop/indexhtm | My First Heading My first paragraph, Q.3 How many types of tags used to markup HTML elements? Also define attributes in HIML Tags. Ans: ‘There are two types of tags in an HTML document. L- Paired Tags 2 gular Tags or empty Tags, Paired Tags Most of the tags in HTML are paired tags. They consist of a start tag, an end tag and contents between them. Syntax: Contents For example, tag p to create a paragraph in HTML document is a paired tag.

I study in 9th Class.

Singular Tags Some tags do not have closing tags and they are called singular tags or empty tags. They are simply written as . For example,
for line break,
to insert « horizontal line Attributes in HTML Tags Attributes are the properties associated with tags. They provide some to a specific tag, Each attribute is given a value. formation with respect Syntax: ‘center"> Content and ends with . It is the top-level tag that contains the whole contents ofa webpage. Syntax: An HTML document primarily consists of two sections. 1- Head Section 2- Body Section 1. Head Section Head section typically defines the document title, styles and other information about the whole document. Head section starts with tag and ends with Syntax: Page Title: to specify title of the webpage, you use tag inside <head> </head> tags. ‘The text between these tags is used to set the title to the page. It is displayed on the title bar of the Web browser. Syntax: <title> Example: “title>First HTML Document<'title> will display First HTML document, on the title bar of the Web browser. 2. Body Section Anything typed inside the body tags will be displayed in the browser window. The visible part ofthe HTML document is between and . Syntax: Q.5 Deseribe the content formatting in HTML. Ans: HTML defines special elements for defining text with a special meaning. Here is the description about performing various content formatting tasks in HTML. Basics Tags for Content Formatting Creating a paragraph ‘The

tag marks starting of a paragraph, and

tag marks closing of the paragraph. The text inside

tags is actual contents of the paragraph. Syntax:

Inserting line breaks ‘The
element inserts a line break without starting a new paragraph. Syntax:
Example:

This is - This is a paragraph > a paragraph

displays text in two lines, as following Inserting spaces If the user wants to have many spaces in a HTML document then the   character entity must be used. You can see that HTML has ignored the multiple spaces inside the text. In order to insert spaces you need to write "Snbsp:" where the space is needed. Syntax:   Example: :  :  :  :    :  : Sanbsp;  : in 9th class.

generates the following output. Istudy in 9th class. for example,

I study &nb: Add Headings/ Sub-headings ‘There are six headings tags,

to
. ‘The

tags are used to specify the largest heading and
tags specify the smallest. Example: Heading 1

Heading 2

Heading 3.

Heading 4

Heading 5 <6 Heading 6 produces the output shown in figure. Heading 1 Heading 2 Heading 3 Heading 4 Heading 5 Heading 6 Q6 explain text formatting tags in HTML with example. Ans’ ‘Text formatting tags are used to format the text in HTML document. Some commonly used text formatting tags are described below. Bold the text: tags will make the text bold that is withi Syntar b> Example: I LOVE PAKISTAN«/b> the tags. Underline the text: Syntar ‘we Example: I LOVE PAKISTAN ‘u> tags will underline the text that is within the tags. I 1c text: Syntax: [LOVE PAKISTAN ‘> tags are used to make the text italic that is within the tags. Below are some examples for usage of these tags, along with their outputs. HIML Code Snippet ‘Output This text is bold This text is bold This text is italic This text is italic This is an underline text ‘This isan underline text Font size: size attribute of tag is used to change the size of text. Syntax: WORLD WIDE WEB tag is used to change the font color of test. Syntax: Replace the ? Symbol with color such as black, blue brown, Gray, green, maroon, orange, pink, red, white, yellow ete. Example: WORLD WIDE WEB fave tag of tag is used to change the font face of text mnta: font face="?"> Replace the ? Symbol with font face such as arial, courier, calibri, Times new roman, ete. Example: WORLD WIDE WEB tag, along with their output HIML Code Snippet Out This is some text! This is some text! This is some text! This is some test! has no effect.
  • ‘The
      tags are used for creating an unordered lists and each item of the list is surrounded with
    • tags. Example: HTML Code Snippet Output